home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Amiga
/
World of Amiga.iso
/
archive
/
assembly
/
docmenu.lha
/
generic_menu2.s
< prev
Wrap
Text File
|
1993-09-25
|
12KB
|
675 lines
Section Copperlist,code_C
opt c-,o+
move.l 4.w,a6 ; open graphics lib
jsr -$84(a6) ; disallow
lea dlib,a1
moveq #0,d0
move.l 4.w,a6
jsr -$228(a6)
tst d0
beq error
move.l D0,dos ; store address of dos lib
lea glib,a1
moveq #0,d0
move.l 4.w,a6
jsr -$228(a6)
tst d0
beq error
move.l D0,graphics ; store address of graphics lib
move.l #Screen+32,d0 ; store address of bitplane0
move.w d0,bitplane0_lo ; into the copper list
swap d0
move.w d0,bitplane0_hi
swap d0
add.l #bplen,d0
move.w d0,bitplane1_lo ; into the copper list
swap d0
move.w d0,bitplane1_hi
swap d0
add.l #bplen,d0
move.w d0,bitplane2_lo ; into the copper list
swap d0
move.w d0,bitplane2_hi
swap d0
add.l #bplen,d0
move.w d0,bitplane3_lo ; into the copper list
swap d0
move.w d0,bitplane3_hi
swap d0
move.l 4.w,a6
move.l #scrsize,d0
move.l #$10002,d1
jsr -198(a6)
move.l d0,screen2
move.l screen2,topline
move.l graphics,a6
add.l #$32,a6
move.w #$80,$dff096 ; dma control write
move.l (a6),old_copper ; store the address of the
move.l #my_copper,(a6) ; old copperlist
move.w #$8080,$dff096 ; dma control write
move.w #$8010,$dff09a ; interupt enable bits
move.l $6c.w,old_interupt ; store old level 3 int
move.l #new_interupt,$6c.w ; store my routine
; into level 3 int
jsr setup_screen
move.w #0,finished
bchg #1,$bfe001 ; turn led off
not: move.w finished,d0
beq.s not
bchg #1,$bfe001 ; turn led on
move.l old_interupt,$6c.w ; resore old level 3 int
move.l #$10,$dff09a ; Disable Level 3 Interupt
move.l graphics,a6
add.l #$32,a6
move.w #$0080,$dff096
move.l old_copper,(a6) ; restore old copper list
move.w #$8080,$dff096
move.l graphics,a1
move.l 4.w,a6
jsr -$19e(a6)
move.l 4.w,a6
jsr -138(a6)
move.l 4.w,a6
move.l screen2,a1
move.l #scrsize,d0
jsr -210(a6)
Error: moveq #0,d0 ; fin
rts
runline: dc.l 0
finished: dc.w 0
new_interupt:
movem.l d0-d7/a0-a6,-(sp)
wait_irq:
and.w #$10,$dff01e
beq no_music
move.w #$10,$dff09c
subq.l #1,times
bmi.s do_keys
move.l topline,d0
add.l step,d0
move.l d0,topline
bra not_down
do_keys:
clr.l d0
clr.l d1
move.b $bfec01,d0
cmp.b #119,d0
bne not_return
move.l ypos,d0
lea commands,a0
cmp.l #0,d0
beq.s found_runline
find1:
cmp.b #0,(a0)+
bne.s find1
subq.l #1,d0
bne.s find1
found_runline:
move.l a0,runline
no_zero:
move.b $bfec01,d0
cmp.b #119,d0
beq.s no_zero
move.l old_interupt,$6c.w ; resore old level 3 int
move.l #$10,$dff09a ; Disable Level 3 Interupt
move.l graphics,a6
add.l #$32,a6
move.w #$0080,$dff096
move.l old_copper,(a6) ; restore old copper list
move.w #$8080,$dff096
move.l graphics,a1
move.l 4.w,a6
jsr -$19e(a6)
move.l 4.w,a6
jsr -138(a6)
move.l runline,a0
move.l (a0),d0
cmp.l #"CLI ",d0
bne.s not_cli
move.w #1,finished
not_cli:
move.l dos,a6
move.l runline,d1
clr d2
clr d3
movem.l d0-d7/a0-a6,-(sp)
jsr -$de(a6)
movem.l (sp)+,d0-d7/a0-a6
move.l 4.w,a6
jsr -$84(a6) ; disallow
lea dlib,a1
moveq #0,d0
move.l 4.w,a6
jsr -$228(a6)
tst d0
beq error
move.l D0,dos ; store address of dos lib
lea glib,a1
moveq #0,d0
move.l 4.w,a6
jsr -$228(a6)
tst d0
beq error
move.l D0,graphics ; store address of graphics lib
move.l graphics,a6
add.l #$32,a6
move.w #$80,$dff096 ; dma control write
move.l (a6),old_copper ; store the address of the
move.l #my_copper,(a6) ; old copperlist
move.w #$8080,$dff096 ; dma control write
move.w #$8010,$dff09a ; interupt enable bits
move.l $6c.w,old_interupt ; store old level 3 int
move.l #new_interupt,$6c.w ; store my routine
bra.s not_down
not_return:
cmp.b #103,d0
bne.s not_up
move.l ypos,d7
beq.s not_up
subq.l #1,ypos
move.l #-80,step
move.l #4,times
move.l topline,d0
add.l #-80,d0
move.l d0,topline
not_up:
cmp.b #101,d0
bne.s not_down
move.l ypos,d7
move.l max,d6
cmp.l d6,d7
beq.s not_down
addq.l #1,ypos
move.l #80,step
move.l #4,times
move.l topline,d0
add.l #80,d0
move.l d0,topline
not_down:
move.l topline,a5
move.l a5,d0 ; store address of bitplane0
move.w d0,bitplane4_lo ; into the copper list
swap d0
move.w d0,bitplane4_hi
add.l #(11*tall*40)-80,a5
move.l a5,d0
lea optical,a0
add.l #10,a0
move.w #8,d1
optic: move.w d0,(a0)
swap d0
addq.l #4,a0
move.w d0,(a0)
swap d0
add.l #16,a0
add.l #40,d0
subq.w #1,d1
bpl.s optic
move.l #2500,d0
pause: dbf d0,pause
no_music:
movem.l (sp)+,d0-d7/a0-a6
dc.w $4ef9 ; jmp
old_interupt: dc.l 0 ; the old int lev 3
setup_screen:
lea cmap,a0
move.w (a0)+,d0
lea screen,a1
move.w #15,d0
cmaploop:
move.w (a1)+,(a0)+
addq.l #2,a0
subq.w #1,d0
bpl.s cmaploop
lea names,a1
move.l screen2,a2
add.l #(11*tall*40)-80,a2
jsr blit_message
moveq.l #10,d0
moveq.l #-7,d7
plot_again:
add.l #40*tall,a2
jsr blit_message
addq.l #1,d7
move.b (a1),d0
bne.s plot_again
move.l d7,max
rts
blit_message:
movem.l d0-d7/a2-a6,-(sp)
move.l a1,a6
clr.b d0
moveq.l #-1,d1
blit_message_loop1:
addq.l #1,d1
move.b (a6),d0
addq #1,a6
cmp.b #0,d0
bne.s blit_message_loop1
move.w d1,d5
and.w #1,d5
asl.w #1,d5
move.w d5,mid
move.l a2,midadd
move.w d1,d5
addq.l #1,d1
lsr.l #1,d1
moveq.l #20,d6
sub.l d1,d6
add.l d6,a2
move.l a2,d2
and.l #$fffffffe,d2
move.l a2,d3
and.l #1,d3
move.l d2,a2
move.w #12,d6
cmp.l #1,d3
beq.s cont_blit_message
add.w #12,mid
subq.l #2,midadd
cont_blit_message:
move.w d6,d7
mulu #8192,d7
subq.w #4,d6
cmp.w #4,d6
bne.s other_half
move.w #12,d6
add.l #80,a2
other_half:
sub.l #40,a2
clr.w d0
lea font,a0
move.b (a1),d0
addq.l #1,a1
cmp.b #0,d0
bne.s mess_is_ok
movem.l (sp)+,d0-d7/a2-a6
move.w mid,d5
mulu #8192,d5
or.w #(%1001*256)+$f0,d5
move.l midadd,a3
Move.l a3,$dff054 ; dest mem d
Move.l a2,$dff050 ; source mem a
Move.w #$ffff,$dff044 ; blit 1st word mask source a
move.w #$ffff,$dff046 ; blit last word mask source a
move.w #0,$dff064 ; blit modulo for source a
move.w d5,$dff040
move.w #0,$dff042 ; blit cont reg 1
Move.w #0,$dff066 ; modulo for dest
Move.w #(8*64)+40,$dff058 ; blit height,width
jsr do_blit
dont_centre:
rts
mess_is_ok:
sub #32,d0
mulu #16,d0
add d0,a0
Move.l a2,$dff054 ; dest mem d
Move.l a0,$dff050 ; source mem a
move.l a2,$dff048 ; source mem c
Move.w #$ffff,$dff044 ; blit 1st word mask source a
move.w #$ffff,$dff046 ; blit last word mask source a
move.w #0,$dff064 ; blit modulo for source a
move.w #38,$dff060 ; blit modulo for source c
or.w #(%1011*256)+$fa,d7
move.w d7,$dff040 ; blit cont reg 0
move.w #0,$dff042 ; blit cont reg 1
Move.w #38,$dff066 ; modulo for dest
Move.w #(8*64)+1,$dff058 ; blit height,width
jsr do_blit
addq.l #1,a2
bra cont_blit_message
do_blit:
btst.b #6,$dff002
bne.s do_blit
rts
tadd equ 230*46
Section copdat,Data_c
names:
dc.b "A",0
dc.b "AA",0
dc.b "AAA",0
dc.b "AAAA",0
dc.b "AAAAA",0
dc.b "AAAAAA",0
dc.b "AAAAAAA",0
dc.b "AAAAAAAA",0
dc.b "AAAAAAAAA",0
dc.b "AAAAAAAAAA",0
dc.b "AAAA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
dc.b "list df1:",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
dc.b "CLI ",0
mid: dc.w 0
midadd: dc.l 0
totalnumber: dc.l 0
old_copper: dc.l 0
graphics: dc.l 0
dos: dc.l 0
my_copper: dc.w $100,$4200 ; 4 bp - lores -
dc.w $104,$a ; bp control reg
dc.w $108,0 ; bp modulo - odd
dc.w $10a,0 ; bp modulo - even
dc.w $180,0 ; colour 0 to black
dc.w $120,0,$122,0
dc.w $182,$fff
dc.w $092,$38 ; bp start horz
dc.w $08e,$2c8c ; bp window start left
dc.w $090,$2ce3 ; bp window bot right
dc.w $094,$2dd0 ; bp stop horz
cmap: dc.w $180,0
dc.w $182,0
dc.w $184,0
dc.w $186,0
dc.w $188,0
dc.w $18a,0
dc.w $18c,0
dc.w $18e,0
dc.w $190,0
dc.w $192,0
dc.w $194,0
dc.w $196,0
dc.w $198,0
dc.w $19a,0
dc.w $19c,0
dc.w $19e,0
dc.w $0e0
bitplane0_hi: dc.w 0
dc.w $e2
bitplane0_lo: dc.w 0,$e4
bitplane1_hi: dc.w 0
dc.w $e6
bitplane1_lo: dc.w 0,$e8
bitplane2_hi: dc.w 0
dc.w $ea
bitplane2_lo: dc.w 0,$ec
bitplane3_hi: dc.w 0
dc.w $ee
bitplane3_lo: dc.w 0
dc.b top_of_copper,1
dc.w $ff00,$182,$000
dc.w $100,$1200 ; 1 bp - lores
dc.w $0e0
bitplane4_hi: dc.w 0
dc.w $e2
bitplane4_lo: dc.w 0
dc.b top_of_copper+1,1
dc.w $ff00,$182,$222
dc.b top_of_copper+2,1
dc.w $ff00,$182,$444
dc.b top_of_copper+3,1
dc.w $ff00,$182,$666
dc.b top_of_copper+4,1
dc.w $ff00,$182,$888
dc.b top_of_copper+5,1
dc.w $ff00,$182,$aaa
dc.b top_of_copper+6,1
dc.w $ff00,$182,$ccc
dc.b top_of_copper+7,1
dc.w $ff00,$182,$eee
dc.b top_of_copper+8,1
dc.w $ff00,$182,$fff
optical:
dc.b down+00,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$200
dc.b down+02,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$600
dc.b down+04,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$a00
dc.b down+06,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$f00
dc.b down+08,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$a00
dc.b down+10,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$600
dc.b down+12,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$200
dc.b down+14,1
dc.w $ff00,$108,-40,$e2,0,$e0,0,$180,$000 ; decender line
dc.b down+16,1
dc.w $ff00,$108, 0,$e2,0,$e0,0,$180,$000 ; decender line
dc.w $ffe1,$fffe ; wait for end of ntsc screen
dc.w $2501,$ff00,$182,$fff
dc.w $2601,$ff00,$182,$eee
dc.w $2701,$ff00,$182,$ccc
dc.w $2801,$ff00,$182,$aaa
dc.w $2901,$ff00,$182,$888
dc.w $2a01,$ff00,$182,$666
dc.w $2b01,$ff00,$182,$444
dc.w $2c01,$ff00,$182,$222
dc.w $2d01,$ff00,$182,0
dc.w $3001,$ff00 ; wait for end of pal screen
dc.w $9c,$8010 ; irq set bits - ?
dc.w $ffff,$fffe ; end of copper list
glib: dc.b "graphics.library",0
even
dlib: dc.b "dos.library",0
even
tall equ 10
screen: incbin "doclogo.bin"; must have the colour map before the
; image, must be 40 horz and any
; size vertically (within reason).
scrsize: equ 40*tall*176 ; 150 names + 13 top + 13 bottom
screen2: dc.l 0
font: incbin "chrset.wrd"
even
topline: dc.l 0
times: dc.l 0
step: dc.l 0
ypos: dc.l 0
max: dc.l 0
bplen equ ((screen2-screen)-32)/4
top_of_copper equ 44+(bplen/40)
down equ top_of_copper+108
lookup_list: dcb.l 150,0
End